﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Bary</title>
<link rel="stylesheet" type="text/css" id="css" href="Resource/css/main.css">

<link rel="stylesheet" type="text/css" href="Resource/yui/build/fonts/fonts-min.css" />
<link rel="stylesheet" type="text/css" href="Resource/yui/build/datatable/assets/skins/sam/datatable.css" />
<script type="text/javascript" src="Resource/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="Resource/yui/build/connection/connection-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/json/json-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/element/element-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/paginator/paginator.js"></script>
<script type="text/javascript" src="Resource/yui/build/datasource/datasource-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/datatable/datatable-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/utilities/utilities.js"></script>

<%
	String pid = request.getParameter("pid");
%>
<body id="yahoo-com" class=" yui-skin-sam">
	<div id="framed">
  	<h2>尺码明细管理</h2>
  </div>
  
  <!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->

<div id="demo">
    <div id="paging"></div>
    <div id="dt"></div>
    <br />
    <div id="function"><input type="button" value="增加尺码" onclick="addSize()" /> &nbsp; <input type="button" value="返回" onclick="returnSize()" /></div>
</div>


<script type="text/javascript">
var myDataTable = null;
YAHOO.util.Event.onDOMReady(function () {
    	
    	  var DataSource = YAHOO.util.DataSource,
        DataTable  = YAHOO.widget.DataTable,
        Paginator  = YAHOO.widget.Paginator;
        

       
//pid=<%=pid%>
        var myDataSource = new DataSource("sizeDetailListInit.do?");
        myDataSource.responseType = DataSource.TYPE_JSON;
        myDataSource.responseSchema = {
        		resultsList :"returnObj",  
            fields: ["code","content","descibe"],
            metaFields: {totalRecords: "totalRecords" }     
        };
				
				var myConfigs = {
					initialRequest: "pid=<%=pid%>"	
				};
		    
		    var myColumnDefs = [
            {key:"code",label:"尺码类型"},
            {key:"content",label:"尺码"},
            {key:"descibe",label:"描述"}
        ];

        myDataTable = new DataTable("dt", myColumnDefs, myDataSource,myConfigs);
				myDataTable.subscribe("rowMouseoverEvent", myDataTable.onEventHighlightRow);   
	      myDataTable.subscribe("rowMouseoutEvent", myDataTable.onEventUnhighlightRow);   
	      myDataTable.subscribe("rowClickEvent", myDataTable.onEventSelectRow);   
            

       
});

function addSize(){
		location.href = "addSizeDetailPage.do?pid=<%=pid%>";
}

function returnSize(){
	location.href = "sizeList.do";
}
</script>

<!--END SOURCE CODE FOR EXAMPLE =============================== -->
  
  </body>
</html>